home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / NextAnswers / 1383_login_and_logout_hooks.rtf < prev    next >
Text File  |  1993-11-08  |  3KB  |  52 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fmodern Courier;\f2\fmodern Ohlfs;}
  2. \paperw11440
  3. \paperh9440
  4. \margl120
  5. \margr120
  6. {\colortbl;\red0\green0\blue0;\red84\green84\blue84;\red83\green83\blue83;\red82\green82\blue82;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fc0\cf0 Q:  How do you execute ~/.login, ~/.cshrc, ~/.profile, or ~/.logout without invoking Terminal, Shell, or a similar sort of shell-based terminal emulator?  Is there a hook in Workspace Manager that allows you do something when you log in or log out?\
  8. \
  9. A:  All the shell run control files (the ones mentioned above) are shell-specific.  .cshrc, .login, and .logout pertain to the C-Shell; .profile pertains to the Bourne Shell.  Only those programs examine and execute these files.  (By implication, then, if your login shell is neither csh nor sh, these files are not executed even when you launch Terminal or Shell.)\
  10. \
  11. There is a "LoginHook" and a "LogoutHook" in 
  12. \b loginwindow
  13. \b0 .  The LoginHook is run just before loginwindow launches the specified workspace (by default, the NeXT Workspace Manager; but this can be overridden in the user's defaults database), and after account verification.  Note that the LoginHook is NOT run under the Workspace Manager, but rather is run BEFORE the Workspace Manager.  LogoutHook is run after the Workspace Manager terminates.\
  14. \
  15. To set up these hooks, type:\
  16.  
  17. \f1 \
  18.  
  19. \fs24     myhost% 
  20. \b su
  21. \b0 \
  22.     myhost# 
  23. \b dwrite loginwindow LoginHook someProgram
  24. \b0 \
  25.     myhost# 
  26. \b dwrite loginwindow LogoutHook someOtherProgram
  27. \b0 \
  28.     myhost# 
  29. \b exit
  30. \b0 \
  31.  
  32. \fs28 \
  33.  
  34. \f0 where the final argument to 
  35. \b dwrite
  36. \b0  is the name of whatever program you want to run.
  37. \b   
  38. \b0 This creates the default on a machine-by-machine basis, since the information is stored in the directory /.NeXT.  (Of course, if you have netboot clients, it need only be done on the servers of all the clients, since the root directory is shared.
  39. \b )\
  40.  
  41. \b0 \
  42. Note that neither hook is run if an automatic "me" login is performed.  The real philosophy behind the hooks is to provide additional accounting or authentication, rather than setting up the Workspace Manager's environment.  If something is required within the Workspace Manager's environment, the only real option is to have a program of your specification autolaunched from your dock.\
  43. \
  44. See 
  45. \fc1\cf1 /NextLibrary/Documentation/NextAdmin/11_StartupShutdown/_ObservingTheBootProcess.rtf for more information on loginwindow.\
  46. \
  47. QA500\
  48. \
  49. Valid for 1.0, 2.0, 3.0\
  50. \
  51.  
  52.